import { ApiProperty } from '@nestjs/swagger'
import { IsOptional, MaxLength, IsEnum } from 'class-validator'
import { CalendarTypeEnum } from 'src/types/calendar'

export class CreateCalendarDto {
  @ApiProperty({ example: 1, description: '日程类型', enum: CalendarTypeEnum })
  @IsEnum(CalendarTypeEnum, { message: '日程类型不符合规范' })
  type: number
  @ApiProperty({ example: '日程标题', description: '日程标题' })
  @MaxLength(20, { message: '日程标题不能超过20个字符' })
  title: string
  @ApiProperty({ example: '2020-01-01 00:00:00', description: '开始时间' })
  startTime: string
  @ApiProperty({ example: '2020-01-01 00:00:00', description: '结束时间' })
  @IsOptional()
  endTime?: string
  @ApiProperty({ example: '2020-01-01 00:00:00', description: '提醒时间' })
  @IsOptional()
  remindTime?: string
  @ApiProperty({ example: '日程地点', description: '日程地点' })
  @IsOptional()
  address?: string
  @ApiProperty({ example: '日程备注', description: '日程备注' })
  @IsOptional()
  remark?: string
  @ApiProperty({ example: 1, description: '员工id' })
  staffId: number
}
